package test;

import entity.User;
import util.DruidUtils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class test {
    public static void main(String[] args) throws SQLException {
        String sql="select * from t_user";
        Connection connection= DruidUtils.getConnection();
        PreparedStatement preparedStatement = connection.prepareStatement(sql);
        ResultSet resultSet = preparedStatement.executeQuery();
        while(resultSet.next()){
            String userName = resultSet.getString("userName");
            String password = resultSet.getString("password");
            System.out.println(userName+" "+password);
        }

    }

}
